<?php

use common\helpers\Html;
use yii\grid\GridView;
use common\models\bonus\Bonus;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', '释放奖金');
$this->params['breadcrumbs'][] = $this->title;
?>


<div class="row">
    <div class="col-xs-12">
        <div class="box">
             <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">
                    
                </div>
            </div>
            <div style="padding: 20px; display: none;">
                <?php foreach ($list as $key => $value): ?>
                    <span>未释放<?= Bonus::getBonusName($key) ?>金额：<span style="color: red"><?= $value?:0.00 ?></span></span>&nbsp;&nbsp; <?=Html::a('释放', ['edit-sf', 'str' => $key],[    
                            'class' => 'btn btn-success btn-xs',
                            'onclick' => 'if(!confirm("是否确认释放"))return false;'
                        ]) ?>
                    <br/>
                    <br/>
                <?php endforeach ?>

              
            </div>
            <div class="box-body table-responsive">
            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'columns' => [
                    ['class' => 'yii\grid\SerialColumn'],

                    'created_at:datetime',
                    // 'datetime:date',
                    [
                        'attribute'=> 'type',
                        'value' => function($model){
                            return Bonus::getBonusName($model->type);
                        }
                    ],
                    'amount',
                   [
                        'header' => '',
                        'value'=>function($model){
                            return Html::linkButton(['member-log','id'=>$model->id], '详情');
                        },
                        'format' => 'raw'
                    ],
                ],
            ]); ?>
</div>
